stop_service_jenkins:
  cmd.run:
    - name: |
        service jenkins stop
    - onlyif: test -f /etc/init.d/jenkins
    
copy_file_jenkins:
  file.managed:
    - name: /usr/lib/jenkins/jenkins.war
    - source: salt://jenkins2/files/jenkins_2.5.war
    - onlyif: test -f /usr/lib/jenkins/jenkins.war

start_service_jenkins:
  cmd.run:
    - name: |
        service jenkins start
    - onlyif: test -f /etc/init.d/jenkins